package com.shop.entity;

// Generated 2015-10-17 15:06:51 by Hibernate Tools 4.0.0

import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Product generated by hbm2java
 */
@Entity
@Table(name = "product", catalog = "shop")
public class Product implements java.io.Serializable {

	private Integer prodId;
	private Promotion promotion;
	private ThirdClass thirdClass;
	private Shop shop;
	private String prodUuid;
	private BigDecimal prodPrice;
	private int prodStore;
	private String prodName;
	private Date prodDate;
	private int prodSell;
	private String prodDesc;
	private String prodType;
	private BigDecimal prodWeight;
	private String prodCode;
	private BigDecimal prodShipping;
	private int prodFoll;
	private int prodCommentNum;
	private float prodTotalscore;
	private Integer templateId;
	private Set<PictureRelate> pictureRelates = new HashSet<PictureRelate>(0);
	private Set<Collect> collects = new HashSet<Collect>(0);
	private Set<ProdCommt> prodCommts = new HashSet<ProdCommt>(0);
	private Set<SkuProd> skuProds = new HashSet<SkuProd>(0);

	public Product() {
	}

	public Product(Shop shop, String prodUuid, BigDecimal prodPrice,
			int prodStore, String prodName, Date prodDate, int prodSell,
			String prodDesc, String prodType, BigDecimal prodWeight,
			String prodCode, BigDecimal prodShipping, int prodFoll,
			int prodCommentNum, float prodTotalscore) {
		
		this.shop = shop;
		this.prodUuid = prodUuid;
		this.prodPrice = prodPrice;
		this.prodStore = prodStore;
		this.prodName = prodName;
		this.prodDate = prodDate;
		this.prodSell = prodSell;
		this.prodDesc = prodDesc;
		this.prodType = prodType;
		this.prodWeight = prodWeight;
		this.prodCode = prodCode;
		this.prodShipping = prodShipping;
		this.prodFoll = prodFoll;
		this.prodCommentNum = prodCommentNum;
		this.prodTotalscore = prodTotalscore;
	}
	
	public Product(Product product) {
		this.prodId = product.getProdId();
		this.shop = product.getShop();
		this.prodUuid = product.getProdUuid();
		this.prodPrice = product.getProdPrice();
		this.prodStore = product.getProdStore();
		this.prodName = product.getProdName();
		this.prodDate = product.getProdDate();
		this.prodSell = product.getProdSell();
		this.prodDesc = product.getProdDesc();
		this.prodType = product.getProdType();
		this.prodWeight = product.getProdWeight();
		this.prodCode = product.getProdCode();
		this.prodShipping = product.getProdShipping();
		this.prodFoll = product.getProdFoll();
		this.prodCommentNum = product.getProdCommentNum();
		this.prodTotalscore = product.getProdTotalscore();
	}

	public Product(Promotion promotion, ThirdClass thirdClass, Shop shop,
			String prodUuid, BigDecimal prodPrice, int prodStore,
			String prodName, Date prodDate, int prodSell, String prodDesc,
			String prodType, BigDecimal prodWeight, String prodCode,
			BigDecimal prodShipping, int prodFoll, int prodCommentNum,
			float prodTotalscore, Integer templateId,
			Set<PictureRelate> pictureRelates, Set<Collect> collects,
			Set<ProdCommt> prodCommts, Set<SkuProd> skuProds) {
		this.promotion = promotion;
		this.thirdClass = thirdClass;
		this.shop = shop;
		this.prodUuid = prodUuid;
		this.prodPrice = prodPrice;
		this.prodStore = prodStore;
		this.prodName = prodName;
		this.prodDate = prodDate;
		this.prodSell = prodSell;
		this.prodDesc = prodDesc;
		this.prodType = prodType;
		this.prodWeight = prodWeight;
		this.prodCode = prodCode;
		this.prodShipping = prodShipping;
		this.prodFoll = prodFoll;
		this.prodCommentNum = prodCommentNum;
		this.prodTotalscore = prodTotalscore;
		this.templateId = templateId;
		this.pictureRelates = pictureRelates;
		this.collects = collects;
		this.prodCommts = prodCommts;
		this.skuProds = skuProds;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "prod_id", unique = true, nullable = false)
	public Integer getProdId() {
		return this.prodId;
	}

	public void setProdId(Integer prodId) {
		this.prodId = prodId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "prom_id")
	public Promotion getPromotion() {
		return this.promotion;
	}

	public void setPromotion(Promotion promotion) {
		this.promotion = promotion;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "third_class_id")
	public ThirdClass getThirdClass() {
		return this.thirdClass;
	}

	public void setThirdClass(ThirdClass thirdClass) {
		this.thirdClass = thirdClass;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shop_id", nullable = false)
	public Shop getShop() {
		return this.shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	@Column(name = "prod_uuid", nullable = false, length = 32)
	public String getProdUuid() {
		return this.prodUuid;
	}

	public void setProdUuid(String prodUuid) {
		this.prodUuid = prodUuid;
	}

	@Column(name = "prod_price", nullable = false, precision = 10)
	public BigDecimal getProdPrice() {
		return this.prodPrice;
	}

	public void setProdPrice(BigDecimal prodPrice) {
		this.prodPrice = prodPrice;
	}

	@Column(name = "prod_store", nullable = false)
	public int getProdStore() {
		return this.prodStore;
	}

	public void setProdStore(int prodStore) {
		this.prodStore = prodStore;
	}

	@Column(name = "prod_name", nullable = false, length = 100)
	public String getProdName() {
		return this.prodName;
	}

	public void setProdName(String prodName) {
		this.prodName = prodName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "prod_date", nullable = false, length = 19)
	public Date getProdDate() {
		return this.prodDate;
	}

	public void setProdDate(Date prodDate) {
		this.prodDate = prodDate;
	}

	@Column(name = "prod_sell", nullable = false)
	public int getProdSell() {
		return this.prodSell;
	}

	public void setProdSell(int prodSell) {
		this.prodSell = prodSell;
	}

	@Column(name = "prod_desc", nullable = false, length = 65535)
	public String getProdDesc() {
		return this.prodDesc;
	}

	public void setProdDesc(String prodDesc) {
		this.prodDesc = prodDesc;
	}

	@Column(name = "prod_type", nullable = false, length = 12)
	public String getProdType() {
		return this.prodType;
	}

	public void setProdType(String prodType) {
		this.prodType = prodType;
	}

	@Column(name = "prod_weight", nullable = false, precision = 7)
	public BigDecimal getProdWeight() {
		return this.prodWeight;
	}

	public void setProdWeight(BigDecimal prodWeight) {
		this.prodWeight = prodWeight;
	}

	@Column(name = "prod_code", nullable = false, length = 32)
	public String getProdCode() {
		return this.prodCode;
	}

	public void setProdCode(String prodCode) {
		this.prodCode = prodCode;
	}

	@Column(name = "prod_shipping", nullable = false, precision = 7)
	public BigDecimal getProdShipping() {
		return this.prodShipping;
	}

	public void setProdShipping(BigDecimal prodShipping) {
		this.prodShipping = prodShipping;
	}

	@Column(name = "prod_foll", nullable = false)
	public int getProdFoll() {
		return this.prodFoll;
	}

	public void setProdFoll(int prodFoll) {
		this.prodFoll = prodFoll;
	}

	@Column(name = "prod_comment_num", nullable = false)
	public int getProdCommentNum() {
		return this.prodCommentNum;
	}

	public void setProdCommentNum(int prodCommentNum) {
		this.prodCommentNum = prodCommentNum;
	}

	@Column(name = "prod_totalscore", nullable = false, precision = 12, scale = 0)
	public float getProdTotalscore() {
		return this.prodTotalscore;
	}

	public void setProdTotalscore(float prodTotalscore) {
		this.prodTotalscore = prodTotalscore;
	}

	@Column(name = "template_id")
	public Integer getTemplateId() {
		return this.templateId;
	}

	public void setTemplateId(Integer templateId) {
		this.templateId = templateId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
	public Set<PictureRelate> getPictureRelates() {
		return this.pictureRelates;
	}

	public void setPictureRelates(Set<PictureRelate> pictureRelates) {
		this.pictureRelates = pictureRelates;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
	public Set<Collect> getCollects() {
		return this.collects;
	}

	public void setCollects(Set<Collect> collects) {
		this.collects = collects;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
	public Set<ProdCommt> getProdCommts() {
		return this.prodCommts;
	}

	public void setProdCommts(Set<ProdCommt> prodCommts) {
		this.prodCommts = prodCommts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "product")
	public Set<SkuProd> getSkuProds() {
		return this.skuProds;
	}

	public void setSkuProds(Set<SkuProd> skuProds) {
		this.skuProds = skuProds;
	}

}
